<?php $id="form_".uniqid();?>
<table id="<?php echo $id;?>"></table>
<script>
    $("#<?php echo $id;?>").DataSource({url:'useranalyse/get_effective_user',
        fields:[
            [
                {field:'sort', title:'排序', align:'center',width:100,sortable:true},
                {field:'date',title:'日期', align:'center', width:100, sortable:false},
                {field:'effective_num',title:'有效人数', align:'center',width:120, sortable:true},
                {field:'new_num',title:'新增人数', align:'center' , width:120, sortable:true},
                {field:'man_in',title:'人工入款（元）/笔', align:'center', width:120,  sortable:true},
                {field:'com_in',title:'公司入款（元）/笔', align:'center',width:150,  sortable:true},
                {field:'online_in',title:'线上入款（元）/笔', align:'center',width:150,  sortable:true},
                {field:'card_in',title:'优惠卡入款（元）/笔', align:'center',width:150,  sortable:true},
                {field:'man_out',title:'人工取款（元）/笔', align:'center', width:120,  sortable:true},
                {field:'online_out',title:'线上取款（元）/笔', align:'center',width:120,  sortable:true},
                {field:'res', title:'结果', align:'center',width:120,sortable:false},
            ]

        ], tools:[
            {instant:false},
            <?php if(in_array('ADD',$auth)){?>
            {text:"新增层级",iconCls:"icon-add",handler:function(){
                $('#<?php echo $id?>').DataSource('add',{title:'新增层级',get:'level/edituser?>',full:true});
            }},
            <?php }?>
            {type:'datebox', text:'日期', width:100,name:'sdate'},
            {type:'datebox', text:'-', width:100,name:'edate'},
            {text:"搜索", iconCls:"icon-search", handler:function(){
                $('#<?php echo $id?>').DataSource('search');
            }},
            '-'
        ],
        checkbox:false,
        edit:true,
        footer:true,
        success:function(){

        }
    });

    function edit_pay_type()
    {
        Core.dialog('支付设定','level/pay_set',function(){},true,false);
    }
</script>